<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Dashboard</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->

    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--&lt;!&ndash; Font Awesome &ndash;&gt;-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--&lt;!&ndash; Ionicons &ndash;&gt;-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">

    <style>
        .title{
            height: 30px;
            line-height: 30px;
            border-bottom: 1px solid #bcbcbe;
            font-size: 14px;
            position: relative;
        }
        .title-con{
            position: absolute;
            text-align: center;
            border-top: 1px solid rgb(203, 203, 205);
            border-right: 1px solid rgb(203, 203, 205);
            border-bottom: none;
            border-left: 1px solid rgb(203, 203, 205);
            border-image: initial;
            padding: 0 10px;
            left: 50%;
            bottom: -1px;
            background: #fff;
            margin-left: -200px;

        }
        .list{
            line-height: 24px;
            /*padding-left: 60px;*/
            font-size: 14px;
            color:#333;
            overflow: hidden;
            position: relative;
        }

        .listTitle{
            display: block;
            width: 75px;
            height: 24px;
            text-align: justify;
            left: 0;
            position: absolute;
            top: 6px;
            background: #F4F4F4;
            border-radius: 50px;
            padding: 0 8px;

        }
        .listTitle::after{
            content: '';
            display: inline-block;
            padding-left: 100%;
        }
        .listItme .shuLine{
            display: inline-block;
            position: absolute;
        }
        .listItme{
            color: #228bee;
            margin: 10px 0px;
            /*margin-left: 16px;*/
            cursor: pointer;
            height: 16px;
            line-height: 16px;
            display: inline-block;
            border-right: 1px solid #69acea;
            width: 105px;
            text-align: center;
            position: relative;
        }
        .listItme .hongDian{
            width: 8px;
            height: 8px;
            position: absolute;
            right: 12px;
            top: -4px;

            background: red;
            border-radius: 50%;
        }
    </style>
</head>
<body >
<!-- Content Header (Page header) -->
<section class="content" id="app">
    <div class="myWork iframeHSM" style="min-height: 280px;">
        <div class="title">
            <div class="title-con">
                <span style="display: inline-block;overflow: hidden;vertical-align: middle;height: 24px;line-height: 24px;width: 300px;padding-left: 50px;padding-right: 50px;">我&nbsp;&nbsp;&nbsp;&nbsp;的&nbsp;&nbsp;&nbsp;&nbsp;工&nbsp;&nbsp;&nbsp;&nbsp;作
                <i style="display: inline-block;width: 100%;height: 0;"></i>
                </span>
            </div>
        </div>
        <div class="list" v-for="(item,i) in myWorkList">
            <div class="module" style="float:left;margin-left: 70px;">
                <span class="listItme" v-for="(item2,b) in item.children" @click="gotoPage(item2,'look')">
                    <i class="hongDian" v-if="showHd(item2.name)" :attr-hongDian="item2.name"></i>
                    {{item2.name}}
                </span>

            </div>
            <div class="listTitle">{{item.name}}</div>
        </div>
    </div>
    <!--<div @click="showModel">弹框</div>-->

    <div class="administration iframeHSM"  style="min-height: 275px;">
        <div class="title">
            <div class="title-con">
            <span style="display: inline-block;overflow: hidden;vertical-align: middle;height: 24px;line-height: 24px;width: 300px;padding-left: 50px;padding-right: 50px;">管&nbsp;&nbsp;&nbsp;&nbsp;理&nbsp;&nbsp;&nbsp;&nbsp;报&nbsp;&nbsp;&nbsp;&nbsp;表
                <i style="display: inline-block;width: 100%;height: 0;"></i>
            </span>
            </div>
        </div>
        <div class="list" v-for="(item,i) in administrationList">
            <div class="module" style="float:left;margin-left: 70px;">
                <span class="listItme" v-for="(item2,b) in item.children" @click="gotoPage(item2,'look')">
                    <i class="hongDian" v-if="showHd(item2.name)" :attr-hongDian="item2.name"></i>
                    {{item2.name}}
                </span>
            </div>
            <div class="listTitle">{{item.name}}</div>
        </div>
    </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script>window.jQuery || document.write('<script src="/dist/plugins/jQuery/jquery-2.2.3.min.js"><\/script>','<script src="/dist/plugins/bootstrap/js/bootstrap.min.js"><\/script>','<script src="/dist/plugins/vue/vue.min.js"><\/script>')</script>
<script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>
<script>
    var newWindow;//定义一个窗口，有利于窗口间的通讯
    function makeNewWindow(url) {
        if (!newWindow || newWindow.closed) {
            var width = screen.availWidth;
            var height = screen.availHeight;
            //var left = parseInt((screen.availWidth/2) - (width/2));//屏幕居中
            //var top = parseInt((screen.availHeight/2) - (height/2));
            var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=0";
            newWindow = window.open(url, "subWind", windowFeatures);
        } else {
            // window is already open, so bring it to the front
            newWindow.focus();
        }
        // if (!newWindow || newWindow.closed) {
        //     var width = screen.availWidth;
        //     var height = screen.availHeight;
        //     //var left = parseInt((screen.availWidth/2) - (width/2));//屏幕居中
        //     //var top = parseInt((screen.availHeight/2) - (height/2));
        //     var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
        //     newWindow = window.open(url, "subWind", windowFeatures);
        // } else {
        //     // window is already open, so bring it to the front
        //     newWindow.focus();
        // }
    }
</script>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            currentUser:getCurrentUser(),
            myWorkList:[],
            administrationList:[],
            info:{
                unfinishCount:0,
                proCount:0,
            },
            exam:{
                count:0
            },
            contract:{
                count:0
            },
            waitPayList:{
                count:0
            }
        },
        methods:{
            showHd:function (name) {
                return (name=='付款审核'&&this.waitPayList.count>0)||(name=='培训管理'&&this.exam.count>0)||(name=='合同管理'&&this.contract.count>0)||(name=='事项管理'&&this.info.unfinishCount>0)||(name=='项目管理'&&this.info.proCount>0)
            },
            gotoPage:function (item,pageType) {
                if(item.name=="OA进度"){
                    makeNewWindow("https://docs.qq.com/sheet/DdGVRYWRyT25pRnpI")
                    // window.open("https://docs.qq.com/sheet/BqI21X2yZIht1iTig21n7wwQ1D5rFx2GDWtz0IqrpT1x9EeW1","_blank","height=1000,width=800,scrollbars=no,location=no");
                }else if(item.name=="瀛沣进度"){
                    makeNewWindow("https://docs.qq.com/sheet/DS1RUUnZMSVRtbkRS")
                    // window.open("https://docs.qq.com/sheet/BqI21X2yZIht1iTig21n7wwQ1D5rFx2GDWtz0IqrpT1x9EeW1","_blank","height=1000,width=800,scrollbars=no,location=no");
                }else{
                    top.addTabs({id:item.id,title: item.name,close: true,url:item.url});
                }
            },
            showModel:function () {
//                top.$.alert({type:'topAlert',width:200,title:'保存成功'})
                var txt = "hello World 弹框内容";
                top.$.alert({
                    win:this,
                    height:220,
                    icon:'1', //1成功 2失败 3提示 不穿代表无图标
                    title:'弹框标题',
                    content: '<p>' + txt +'</p>',

                    blankclose: true,//点击空白是否可关闭
                    ok:"确定",//是否显示确认按钮,
                    okCallback:function () {
                        //确认按钮回调
                        console.log(this)
                        console.log("确定回调")
                        console.log(this.win.myWorkList)
                    },
                    cancel:"取消"
                })
            }
        },
        mounted:function () {
            var that=this;
            var H = $(window).height();
            $(".iframeMain").css("minHeight", (H - 24) / 2);
            function menuFormat(data) {
                var i, l,
                    key = "id",
                    parentKey = "parentId",
                    childKey = "children";
                if (!key || key == "" || !data) return [];

                var r = [];
                var tmpMap = [];
                for (i = 0, l = data.length; i < l; i++) {
                    tmpMap[data[i][key]] = data[i];
                }
                for (i = 0, l = data.length; i < l; i++) {
                    if (tmpMap[data[i][parentKey]] && data[i][key] != data[i][parentKey]) {
                        if (!tmpMap[data[i][parentKey]][childKey])
                            tmpMap[data[i][parentKey]][childKey] = [];
                        tmpMap[data[i][parentKey]][childKey].push(data[i]);
                    } else {
                        r.push(data[i]);
                    }
                }
                return r;
            }
            $.ajax({
                url:server.ip + '/right/getMenuByUserId.json',
                data:JSON.stringify({
                    userId:getCurrentUser().id,
                    rightType:2
                }),
                type:'POST',
                dataType:'json',
                contentType: 'application/json;charset=utf-8',
                success:function (r) {
                    that.myWorkList=menuFormat(r.data.sendData);
                }
            });
            $.ajax({
                url:server.ip + '/right/getMenuByUserId.json',
                data:JSON.stringify({
                    userId:getCurrentUser().id,
                    rightType:3
                }),
                type:'POST',
                dataType:'json',
                contentType: 'application/json;charset=utf-8',
                success:function (r) {
                    that.administrationList=menuFormat(r.data.sendData);
                }
            });
//            //事项管理 项目管理
//            $.ajax({
//                url:server.ip + '/wreportUnfinish/getRedDot.json',
//                data:JSON.stringify({
//                    userId:getCurrentUser().id,
//                }),
//                type:'POST',
//                dataType:'json',
//                contentType: 'application/json;charset=utf-8',
//                success:function (r) {
//                  that.info=r.data.sendData;
//                }
//            });
//            //培训管理红点提示
//            $.ajax({
//                url: server.ip + '/exam/getUnDoCount.json',
//                data: {userId: getCurrentUser().id},
//                type: 'GET',
//                dataType: 'json',
//                success: function (r) {
//                    that.exam = r.data.sendData;
//                }
//            });
//            //合同管理红点提示
//            $.ajax({
//                url: server.ip + '/contractMain/getNeedReview.json',
//                data: {userId: getCurrentUser().id},
//                type: 'GET',
//                dataType: 'json',
//                success: function (r) {
//                    that.contract = r.data.sendData;
//                }
//            });
//            //付款审核红点提示
//            $.ajax({
//                url: server.ip + '/apply/getWaitAuditNum.json',
//                data: {userId: getCurrentUser().id},
//                type: 'GET',
//                dataType: 'json',
//                success: function (r) {
//                    that.waitPayList = r.data.sendData;
//                }
//            });
            //每10分钟判断登录信息是否有效
//            setTimeout(function () {
//                var data={
//                    tel:getCurrentUser().tel,
//                    pwd: '1est!*'
//                }
//                $.ajax({
//                    url: server.ip + urlConfig.system.user.login,
//                    type: "post",
//                    async:false,
//                    data:JSON.stringify(data),
//                    success: function (r) {
//                    },error: function (e) {
//                        alert("登录信息失效，请重新登录")
//                        setCurrentUser(null);
//                        $.cookie("loginTel",null);
//                        $.cookie("loginPwd",null);
//                        top.window.location = "/page/login.html?t=" + new Date();
//                    }
//                });
//            },36000000)
        }
    });

</script>
</body>
</html>
